package com.neu.constant;

public enum ProjectStatusEnum {
    S1(10, "前期审批"),
    S2(20, "实施建设"),
    S3(30, "暂停"),
    S4(40, "投产"),
    UNKNOWN(-1, "未知");

    private int code;
    private String msg;

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    ProjectStatusEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static ProjectStatusEnum of(int code) {
        if (code == S1.code) {
            return S1;
        } else if (code == S2.code) {
            return S2;
        } else if (code == S3.code) {
            return S3;
        } else if (code == S4.code) {
            return S4;
        } else {
            return UNKNOWN;
        }
    }
}
